const http = require('http')
const path   = require('path')
const config = require('./config')

const server = http.createServer((req, res) => {
	const dirname = __dirname + '/index.html'
	console.log('path.basename(dirname):', path.basename(dirname))
	console.log('path.isAbsolute(dirname):', path.isAbsolute(dirname))
	console.log('path.dirname(dirname):', path.dirname(dirname))
	console.log('path.extname(dirname):', path.extname(dirname))
	res.statusCode = 200
	res.setHeader('Content-Type', 'text/plain')
	res.end('\n请求成功\n')
})

server.listen(config.port, config.hostname, () => {
	console.log('port', config.port)
})
